import axios from 'axios'
import qs from 'qs'

// var axios = axios.create({
//   headers: {'content-type': 'application/x-www-form-urlencoded'},
//   withCredentials: true
// })

export const adds = (phone, password) => axios.post('/api/', {
  phone: phone,
  password: password
})
/**
 * 获取我的孩子列表
 * */
export const getMyChildrenlist  = () => axios.get(`/api/person/childrenlist`)

/**
 * 删除孩子
 * */
export const delChildById = (childId = '') => axios.delete(`/api/person/${store.state.userInfo.userId}/children/${childId}`)

/**
 * 添加孩子
 * */
export const setChildren = (childName = '', kinship='', genderType='', birthday='', avatar="") => axios.post(`/api/person/new/children`, {
  childName: childName,
  kinship: kinship,
  genderType: genderType,
  birthday: birthday,
  avatar: avatar
})